package com.xdtech.cc.vo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.sql.Timestamp;

import com.xdtech.core.model.BaseItem;
import com.xdtech.core.orm.utils.BeanUtils;
import com.xdtech.cc.model.Account;
import com.xdtech.cc.model.TradeRecord;

import com.xdtech.web.freemark.item.GridColumn;

/**
 * 
 * @author max.zheng
 * @create 2016-05-29 21:53:36
 * @since 1.0
 * @see
 */
public class TradeRecordItem extends BaseItem implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id;
	@GridColumn(title="客户名字",width=60)
	private String accountName;
	@GridColumn(title="手续费点数",width=100)
	private Double handlingFeePoint;
	@GridColumn(title="费用收取日期",width=100)
	private String chargeDate;
	@GridColumn(title="商户名称",width=100)
	private String merchantName;
	@GridColumn(title="商户扣率",width=100)
	private Double merchantFee;
	@GridColumn(title="手续费",width=100)
	private Double handlingFee;
	@GridColumn(title="刷卡金额",width=100)
	private String payCardAmount;
	@GridColumn(title="到账金额",width=100)
	private Double arrivalAmount;
	@GridColumn(title="刷卡时间",width=120)
	private String payCardTime;
	@GridColumn(title="到账时间",width=120)
	private String arrivalAmountTime;
	@GridColumn(title="到账卡",width=100)
	private String arrivalAmountCard;
	
	private Long accountId;
	
	

	public void setId(Long id) {
		this.id = id;
		addQuerys("id", id);
	}
	public Long getId() {
		return id;
	}
	
	public void setHandlingFeePoint(Double handlingFeePoint) {
		this.handlingFeePoint = handlingFeePoint;
		addQuerys("handlingFeePoint", handlingFeePoint);
	}
	public Double getHandlingFeePoint() {
		return handlingFeePoint;
	}
	
	public void setChargeDate(String chargeDate) {
		this.chargeDate = chargeDate;
		addQuerys("chargeDate", chargeDate);
	}
	public String getChargeDate() {
		return chargeDate;
	}
	
	public void setMerchantName(String merchantName) {
		this.merchantName = merchantName;
		addQuerys("merchantName", merchantName);
	}
	public String getMerchantName() {
		return merchantName;
	}
	
	public void setMerchantFee(Double merchantFee) {
		this.merchantFee = merchantFee;
		addQuerys("merchantFee", merchantFee);
	}
	public Double getMerchantFee() {
		return merchantFee;
	}
	
	public void setHandlingFee(Double handlingFee) {
		this.handlingFee = handlingFee;
		addQuerys("handlingFee", handlingFee);
	}
	public Double getHandlingFee() {
		return handlingFee;
	}
	
	public void setPayCardAmount(String payCardAmount) {
		this.payCardAmount = payCardAmount;
		addQuerys("payCardAmount", payCardAmount);
	}
	public String getPayCardAmount() {
		return payCardAmount;
	}
	
	public void setArrivalAmount(Double arrivalAmount) {
		this.arrivalAmount = arrivalAmount;
		addQuerys("arrivalAmount", arrivalAmount);
	}
	public Double getArrivalAmount() {
		return arrivalAmount;
	}
	
	public void setPayCardTime(String payCardTime) {
		this.payCardTime = payCardTime;
		addQuerys("payCardTime", payCardTime);
	}
	public String getPayCardTime() {
		return payCardTime;
	}
	
	public void setArrivalAmountTime(String arrivalAmountTime) {
		this.arrivalAmountTime = arrivalAmountTime;
		addQuerys("arrivalAmountTime", arrivalAmountTime);
	}
	public String getArrivalAmountTime() {
		return arrivalAmountTime;
	}
	
	public void setArrivalAmountCard(String arrivalAmountCard) {
		this.arrivalAmountCard = arrivalAmountCard;
		addQuerys("arrivalAmountCard", arrivalAmountCard);
	}
	public String getArrivalAmountCard() {
		return arrivalAmountCard;
	}
	
	public Long getAccountId() {
		return accountId;
	}
	public void setAccountId(Long accountId) {
		this.accountId = accountId;
		addQuerys("accountId", accountId);
	}
	public String getAccountName() {
		return accountName;
	}
	public void setAccountName(String accountName) {
		this.accountName = accountName;
		addQuerys("accountName", accountName);
	}
	/**
	 * 根据model构建vo
	 * 
	 * @author max
	 * @return
	 */
	public static TradeRecordItem createItem(TradeRecord tradeRecord) {
		TradeRecordItem tradeRecordItem = null;
		if(tradeRecord!=null) {
			tradeRecordItem = new TradeRecordItem();
			BeanUtils.copyProperties(tradeRecordItem, tradeRecord);
			//自定义属性设置填充
		}
		Account account = tradeRecord.getAccount();
		if (account!=null) {
			tradeRecordItem.setAccountId(account.getId());
			tradeRecordItem.setAccountName(account.getAccountName());
		}
		
		return tradeRecordItem;
	}
	/**
	 * 根据model集合创建vo集合
	 * 
	 * @author max
	 * @return
	 */
	public static List<TradeRecordItem> createItems(List<TradeRecord> tradeRecords) {
		List<TradeRecordItem> tradeRecordItems = new ArrayList<TradeRecordItem>();
		for (TradeRecord tradeRecord : tradeRecords) {
			tradeRecordItems.add(createItem(tradeRecord));
		}
		return tradeRecordItems;
	}
}
